<?php


namespace app\site\validate;


use think\Validate;

class UserValidate extends Validate{

    protected $rule =   [
        'mobile'  => 'require|length:11',
        'nickname' => 'require',
        'avatar' => 'require',
//        'password' => 'require|confirm'
    ];

    protected $message  =   [
        'avatar' => '请上传头像',
        'nickname' => '请填写昵称',
//        'mobile.unique' => '手机号已被占用',
        'mobile' => '手机号格式错误',
//        'password.require' => '请填写密码',
//        'password.confirm' => '两次输入密码不一致',
    ];

    protected $scene = [
        'userApiSetUserinfo'  =>  ['nickname','avatar'],
    ];

}
